﻿@model _1._8._2015_AuthExample.Models.AddressIndexViewModel
@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<table class="table table-bordered table-striped">
    <tr>
        @if (User.IsInRole("Admin"))
        {
            <th>Name</th>
        }

        <th>Street</th>
        <th>City</th>
        <th>State</th>
        <th>Zip</th>
    </tr>
    @foreach (var a in Model.Addresses)
    {
        <tr>
            @if (User.IsInRole("Admin"))
            {
                <th>@a.Name</th>
            }
            
            <th>@a.Street</th>
            <th>@a.City</th>
            <th>@a.State</th>
            <th>@a.Zip</th>
        </tr>
    }
</table>